<?php

use app\middleware\Check;
use think\facade\Route;


Route::group("order", function(){
    // 创建订单
    Route::post("/create", "OrderController/createOrder");

    // 获取订单状态
    Route::get("/status/:orderId", "OrderController/getOrderStatus");

    // 添加订单规格
    Route::post("/addSpeci/:orderId", "OrderController/addOrderSpecifications");

    // 获取订单状态统计信息
    Route::get("/orderStatus/:userId", "OrderController/getOrderStatusIcon");

    // 获取订单列表
    Route::get("/list/:userId", "OrderController/getOrdersByUserId");

    // 根据订单号获取订单详情
    Route::get("/getById/:orderId", "OrderController/getOrderById");
});

// 定义订单相关路由
Route::group('order_manage', function () {
    // 订单列表接口
    Route::get('orders', 'OrderController/getOrderList');
    
    // 更新订单状态接口
    Route::put('orders/status', 'OrderController/updateOrderStatus');
})->middleware(Check::class);